package io.kimmking.dubbo.demo.second.provider.controller;


import io.kimmking.dubbo.common.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Kudu
 * @since 2021-08-03
 */
//@RestController
@RequestMapping("/customer")
public class CustomerController {

    @Autowired
    CustomerService customerService;

    @RequestMapping("/getAll")
    public List<String> getAllCustomers(){
        return customerService.list().stream()
                .map(e -> e.toString())
                .collect(Collectors.toList());
    }

}

